﻿<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="HSPCS.Web._Default" %>

<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">

   <asp:PlaceHolder id="myPlaceHolder" runat="server" />
   <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
  <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
    <div id="divcontent"><iframe id="myIframe" src="" style="width:100%;height:100%"></iframe></div>
    <script type="text/javascript">
        $(function () {
        $('a.dialog').click(function () {
                //e.preventDefault();
                var url = $(this).attr('data-href');
                showDialog(url);
                return false;
            });

            $("#divcontent").dialog({  
                autoOpen: false,
                height: 500,
                width: 500,
                modal: true,
                buttons:{
                    Close: function () {
                        $(this).dialog("close");
                    }
                }
            });

            function showDialog(url) {
               // alert($("#divcontent").length);
                //if ($("#divcontent").length > 1)
                //{
                //    $("#divcontent").empty();
                //}
                //$("#divcontent").find(".iframe").attr("src", url);
               // $("#divcontent").parent().appendTo(jQuery("form:first"));
                $("#divcontent").find("#myIframe").attr('src', url);
               
                $("#divcontent").dialog("open");
            }

        });
  </script>
</asp:Content>
